<?php

class FundModel extends Model
{

    public function pay($num)
    {
        $this->find();
        $per = ($this->total) / ($this->parts);
        $dtotal = $per * $num;
        $this->setInc('total', 'atotal = '.($this->atotal), $dtotal);
        $this->setInc('parts', 'atotal = '.($this->atotal), $num);
        $this->find();
    }

    public function financial($amount)
    {
        $this->find();
        $this->setInc('total', 'atotal = ' . $this->atotal, $amount);
    }

    public function income($amount)
    {
        $this->find();
        $this->setInc('total', 'atotal = ' . ($this->atotal), $amount);
        $this->setInc('atotal', 'atotal = ' . ($this->atotal), $amount);
        $this->find();
    }
}

?>